1. Field of the Invention
The present invention generally relates to a method for operating a memory device, in particular, to a method for operating a flash memory.
2. Description of Related Art
The flash memory is capable of repeatedly storing, reading, and erasing data, and the stored data may not disappear when the power is off. Due to the above advantages, the flash memory becomes a non-volatile memory device widely applied in electronic devices such as personal computers, portable computers, and digital cameras. However, after the flash memory is used for a while, some error bits may occur, and further result in data access errors. In view of the above, the conventional art generally adopts an error correction code for error correction.
FIGS. 1A and 1B are respectively flow charts of methods for programming and reading a flash memory by using an error correction code in the conventional art. As shown in FIG. 1A, during the process of programming the flash memory, in the conventional art, after received user data is stored in a register (Steps S111 and S112), the error correction code is generated according to the user data (Step S113), and the user data and the error correction code are written to the flash memory (Step S114). Therefore, referring to FIG. 1B, during the process of reading the flash memory, in the conventional art, after the read error correction code and read data are stored in the register (Steps S121 and S122), the user data is obtained by correcting the read data with the error correction code (Step S123). Accordingly, in the conventional art, the user data can be registered and output (Steps S124 and S125).
It should be noted that, for a multi-level cell (hereinafter referred to as MLC) flash memory, the bit information is recorded by a plurality of different levels of threshold voltages, such that in FIG. 2, for the MLC flash memory, usually a read level RD cannot recognize the bit information due to an overlap distribution 210 of the threshold voltages VT. Further, over-program and charge loss of the memory cell are the main reasons of the threshold voltage offset. The over-program occurs during the process of writing the user data to the flash memory, and the charge losses are increasingly accumulated with the cyclic operation of the memory cell.
In the conventional art, the error correction is performed by using only a single error correction code generated before the user data is written. Thus, for errors occurring due to over-program in the process of writing the user data or due to charge loss after the user data is written, the correctable bit number of the error correction code must be continuously increased to complete the error correction. However, with the increase of the correctable bit number of the error correction code, the conventional art must add hardware facilities to support the complicated and huge error correction code computation. Moreover, the more ECC correcting code in order to have the enough correcting ability will need more silicon area to save them.